<?
// Safely assumes $_GET variable 'type' is set.
$typeId  = $_GET['type'];
$typeName  = lookup_typeById($typeId);

?>

<div id="navigation">
    <h2><?=$typeName?></h2>
    <div id="nav_types">
	<ul class="navList">
	    <?
	    $categories = array();
	    $categories = getBrandsByType($typeId);
	    
	    foreach($categories as $cat) {
		echo "<li>";
		echo '<a href="browse.php?type='.$typeId.'&&brand='.$cat.'">';
		echo lookup_brandById($cat);
		echo " <span class=\"parentheticalCount\">(".countProducts($typeId, $cat).")</span>";
		echo "</a></li>";
	    }
	    
	    ?>
	</ul>
    </div>
</div>